I am trying to run the following command:
aws cloudformation update-stack --stack-name $stack.Trim('"') --use-previous-template --parameters file://./parameters.json
This is the content of parameters.json (you can copy and paste here to check it is a valid JSON string):
[{"ParameterKey":"directoryName","UsePreviousValue":true},{"ParameterKey":"CodeDeployServiceRole","UsePreviousValue":true},{"ParameterKey":"ApplicationType","UsePreviousValue":true},{"ParameterKey":"EnvironmentCode","UsePreviousValue":true},{"ParameterKey":"InstanceRoleInstanceProfile","UsePreviousValue":true},{"ParameterKey":"VPCID","UsePreviousValue":true},{"ParameterKey":"SecurityGroupList","UsePreviousValue":true},{"ParameterKey":"KeyName","UsePreviousValue":true},{"ParameterKey":"Subnets","UsePreviousValue":true},{"ParameterKey":"dnsIpAddresses","UsePreviousValue":true},{"ParameterKey":"directoryId","UsePreviousValue":true},{"ParameterKey":"directoryBIOS","UsePreviousValue":true},{"ParameterKey":"ScalingTermination","UsePreviousValue":true},{"ParameterKey":"EC2ScaleUpCooldown","UsePreviousValue":true},{"ParameterKey":"AttributeDelayTimeout","UsePreviousValue":true},{"ParameterKey":"CwLowOperator","UsePreviousValue":true},{"ParameterKey":"EBSOptimized","UsePreviousValue":true},{"ParameterKey":"PatchingGroupTag","UsePreviousValue":true},{"ParameterKey":"CwHighOperator","UsePreviousValue":true},{"ParameterKey":"SSMInventoryTag","UsePreviousValue":true},{"ParameterKey":"CwHighEvaluations","UsePreviousValue":true},{"ParameterKey":"EC2ScaleUpAdjustment","UsePreviousValue":true},{"ParameterKey":"CwScalingMetric","UsePreviousValue":true},{"ParameterKey":"HealthyThresholdCount","UsePreviousValue":true},{"ParameterKey":"ImageId","ParameterValue":"ami-0b2e03736f1241bbb"},{"ParameterKey":"CodeDeployServiceRole","UsePreviousValue":true},{"ParameterKey":"directoryName","UsePreviousValue":true},{"ParameterKey":"HealthCheckIntervalSeconds","UsePreviousValue":true},{"ParameterKey":"ReleaseId","UsePreviousValue":true},{"ParameterKey":"UnhealthyThresholdCount","UsePreviousValue":true},{"ParameterKey":"EC2ScaleDownAdjustment","UsePreviousValue":true},{"ParameterKey":"ApplicationType","UsePreviousValue":true},{"ParameterKey":"EnvironmentCode","UsePreviousValue":true},{"ParameterKey":"Environment","UsePreviousValue":true},{"ParameterKey":"EbsVolumeType","UsePreviousValue":true},{"ParameterKey":"BackupsEnabled","UsePreviousValue":true},{"ParameterKey":"CwLowPeriod","UsePreviousValue":true},{"ParameterKey":"HealthCheckType","UsePreviousValue":true},{"ParameterKey":"InstanceRoleInstanceProfile","UsePreviousValue":true},{"ParameterKey":"ServiceLevel","UsePreviousValue":true},{"ParameterKey":"TerminatedInstances","UsePreviousValue":true},{"ParameterKey":"VPCID","UsePreviousValue":true},{"ParameterKey":"HealthCheckPath","UsePreviousValue":true},{"ParameterKey":"CwHighPeriod","UsePreviousValue":true},{"ParameterKey":"HealthCheckGracePeriod","UsePreviousValue":true},{"ParameterKey":"HealthCheckTimeoutSeconds","UsePreviousValue":true},{"ParameterKey":"CustomCWConfig","UsePreviousValue":true},{"ParameterKey":"ScalingMin","UsePreviousValue":true},{"ParameterKey":"SecurityGroupList","UsePreviousValue":true},{"ParameterKey":"CwLowEvaluations","UsePreviousValue":true},{"ParameterKey":"directoryBIOS","UsePreviousValue":true},{"ParameterKey":"CustomSSMStepCount","UsePreviousValue":true},{"ParameterKey":"ScalingMax","UsePreviousValue":true},{"ParameterKey":"InstanceType","UsePreviousValue":true},{"ParameterKey":"EncryptEBSVolume","UsePreviousValue":true},{"ParameterKey":"SSMRefreshFrequency","UsePreviousValue":true},{"ParameterKey":"CwHighThreshold","UsePreviousValue":true},{"ParameterKey":"CustomSSMSteps","UsePreviousValue":true},{"ParameterKey":"MinInstancesInService","UsePreviousValue":true},{"ParameterKey":"MatcherCode","UsePreviousValue":true},{"ParameterKey":"EbsVolumeSize","UsePreviousValue":true},{"ParameterKey":"EC2ScaleDownCooldown","UsePreviousValue":true},{"ParameterKey":"Iops","UsePreviousValue":true},{"ParameterKey":"KeyName","UsePreviousValue":true},{"ParameterKey":"Subnets","UsePreviousValue":true},{"ParameterKey":"dnsIpAddresses","UsePreviousValue":true},{"ParameterKey":"CWLogRetention","UsePreviousValue":true},{"ParameterKey":"EnableRackspaceTicket","UsePreviousValue":true},{"ParameterKey":"CwLowThreshold","UsePreviousValue":true},{"ParameterKey":"directoryId","UsePreviousValue":true},{"ParameterKey":"ScalingNotificationTopic","UsePreviousValue":true},{"ParameterKey":"LoadBalancerFullName","UsePreviousValue":true}]
I get this when I run the command:
aws :
At line:1 char:1
+ aws cloudformation update-stack --stack-name $stack.Trim('"') --templ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Error parsing parameter '--parameters': Expected: '=', received: 'ÿ' for input:
ÿþ[ { " P a r a m e t e r K e y " : " d i r e c t o r y N a m e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C o d e D e p l o y S e r v i c e R o l e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r
a m e t e r K e y " : " A p p l i c a t i o n T y p e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E n v i r o n m e n t C o d e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y "
: " I n s t a n c e R o l e I n s t a n c e P r o f i l e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " V P C I D " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S e c u r i t
y G r o u p L i s t " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " K e y N a m e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S u b n e t s " , " U s e P r e v i o u s V a
l u e " : t r u e } , { " P a r a m e t e r K e y " : " d n s I p A d d r e s s e s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " d i r e c t o r y I d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r
a m e t e r K e y " : " d i r e c t o r y B I O S " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S c a l i n g T e r m i n a t i o n " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y
" : " E C 2 S c a l e U p C o o l d o w n " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " A t t r i b u t e D e l a y T i m e o u t " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " :
" C w L o w O p e r a t o r " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E B S O p t i m i z e d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " P a t c h i n g G r o u p T
a g " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w H i g h O p e r a t o r " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S S M I n v e n t o r y T a g " , " U s e P r e v
i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w H i g h E v a l u a t i o n s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E C 2 S c a l e U p A d j u s t m e n t " , " U s e P r e v i o u
s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w S c a l i n g M e t r i c " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " H e a l t h y T h r e s h o l d C o u n t " , " U s e P r e v i o u s V a l u
e " : t r u e } , { " P a r a m e t e r K e y " : " I m a g e I d " , " P a r a m e t e r V a l u e " : " a m i - 0 b 2 e 0 3 7 3 6 f 1 2 4 1 b b b " } , { " P a r a m e t e r K e y " : " C o d e D e p l o y S e r v i c e R o l e " , " U s e P r e v i o u
s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " d i r e c t o r y N a m e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " H e a l t h C h e c k I n t e r v a l S e c o n d s " , " U s e P r e v i o u s V
a l u e " : t r u e } , { " P a r a m e t e r K e y " : " R e l e a s e I d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " U n h e a l t h y T h r e s h o l d C o u n t " , " U s e P r e v i o u s V a l u e " : t r
u e } , { " P a r a m e t e r K e y " : " E C 2 S c a l e D o w n A d j u s t m e n t " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " A p p l i c a t i o n T y p e " , " U s e P r e v i o u s V a l u e " : t r u e } ,
{ " P a r a m e t e r K e y " : " E n v i r o n m e n t C o d e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E n v i
r o n m e n t " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E b s V o l u m e T y p e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " B a c k u p s E n a b l e d " , " U s e
P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w L o w P e r i o d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " H e a l t h C h e c k T y p e " , " U s e P r e v i o u s V a l u e " :
t r u e } , { " P a r a m e t e r K e y " : " I n s t a n c e R o l e I n s t a n c e P r o f i l e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S e r v i c e L e v e l " , " U s e P r e v i o u s V a l u e " : t
r u e } , { " P a r a m e t e r K e y " : " T e r m i n a t e d I n s t a n c e s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " V P C I D " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K
e y " : " H e a l t h C h e c k P a t h " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w H i g h P e r i o d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " H e a l t h C h
e c k G r a c e P e r i o d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " H e a l t h C h e c k T i m e o u t S e c o n d s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C u
s t o m C W C o n f i g " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S c a l i n g M i n " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S e c u r i t y G r o u p L i s t "
, " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w L o w E v a l u a t i o n s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " d i r e c t o r y B I O S " , " U s e P r e v i o u
s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C u s t o m S S M S t e p C o u n t " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S c a l i n g M a x " , " U s e P r e v i o u s V a l u e " : t r u e
} , { " P a r a m e t e r K e y " : " I n s t a n c e T y p e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E n c r y p t E B S V o l u m e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r
K e y " : " S S M R e f r e s h F r e q u e n c y " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w H i g h T h r e s h o l d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : "
C u s t o m S S M S t e p s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " M i n I n s t a n c e s I n S e r v i c e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " M a t c h e
r C o d e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E b s V o l u m e S i z e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E C 2 S c a l e D o w n C o o l d o w n " ,
" U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " I o p s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " K e y N a m e " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r
a m e t e r K e y " : " S u b n e t s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " d n s I p A d d r e s s e s " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C W L o g R e
t e n t i o n " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " E n a b l e R a c k s p a c e T i c k e t " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " C w L o w
T h r e s h o l d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " d i r e c t o r y I d " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " S c a l i n g N o t i f i c a t i o n T
o p i c " , " U s e P r e v i o u s V a l u e " : t r u e } , { " P a r a m e t e r K e y " : " L o a d B a l a n c e r F u l l N a m e " , " U s e P r e v i o u s V a l u e " : t r u e } ]
^
I have run the command using --debug and noticed that it tries to parse the parameters using shorthand syntax:
2019-04-15 14:11:36,069 - MainThread - botocore.hooks - DEBUG - Event process-cli-arg.cloudformation.update-stack: calling handler <awscli.argprocess.ParamShorthandParser object at 0x0000020212160F28>
2019-04-15 14:11:36,070 - MainThread - awscli.argprocess - DEBUG - Parsing param --parameters as shorthand
I cannot find any way to force the CLI to parse the parameters using JSON syntax rather than shorthand. From the docs, it looks like it should do that automatically.
Any ideas why it tries to use the shorthand syntax?
It looks like the issue was the encoding for parameters.json.
I think the CLI could not parse parameters.json due to the encoding of the file, and was therefore trying to parse the parameters using the shorthand syntax rather than the JSON syntax.
I created the file using the following code:
$parameters = "{""ParameterKey"":""directoryName"",""UsePreviousValue"":true},{""ParameterKey"":""CodeDeployServiceRole"",""UsePreviousValue"":true},{""ParameterKey"":""ApplicationType"",""UsePreviousValue"":true},{""ParameterKey"":""EnvironmentCode"",""UsePreviousValue"":true},{""ParameterKey"":""InstanceRoleInstanceProfile"",""UsePreviousValue"":true},{""ParameterKey"":""VPCID"",""UsePreviousValue"":true},{""ParameterKey"":""SecurityGroupList"",""UsePreviousValue"":true},{""ParameterKey"":""KeyName"",""UsePreviousValue"":true},{""ParameterKey"":""Subnets"",""UsePreviousValue"":true},{""ParameterKey"":""dnsIpAddresses"",""UsePreviousValue"":true},{""ParameterKey"":""directoryId"",""UsePreviousValue"":true},{""ParameterKey"":""directoryBIOS"",""UsePreviousValue"":true},"
# generate json file with parameters for stack
foreach ($parameter in $stackJson.Stacks.Parameters){
$parameterKey = $parameter.ParameterKey
if ($parameterKey -eq "ImageId"){
$parameters += "{""ParameterKey"":""$parameterKey"",""ParameterValue"":""$latestAmiId""},"
}
else {
$parameters += "{""ParameterKey"":""$parameterKey"",""UsePreviousValue"":true},"
}
}
$parameters = $parameters.TrimEnd(',')
$parameters = "[" + $parameters + "]"
#$parameters = ConvertFrom-Json $parameters
$parameters | Out-File .\parameters.json
Adding -Encoding ascii to the Out-File command solved the issue.
Somebody can guide me (maybe Simple and fast query if there is or some fast code) to convert my CSV data file (with commas separation):
1,A,C,Z,F,G
2,G,Q,R,C,
3,Z,G,Q,
4,C,F,
5,O,P,
6,O,X,Y,J,
7,A,P,X,
I have this table with ~1,000,000 records
like these 7 records that you see (In real Database A,B,C,... are words in string), Records 1 and 2 are common in G and C value and 2,3 and 1,3 and ...
I want to sync records if they have at least two common value like Records 1 & 2,3,4 (but record 5,6,7 haven't at least 2 shared values with others) and generate a list like this:
1 A C Z F G Q R
2 G Q R C A Z F
3 Z G Q A C F R
4 C F A Z G Q R
5 O P
6 O X Y J
7 A P X
at the end we must have 4 same records if we sort data and one others without sync:
1 A C F G Q R Z
2 A C F G Q R Z
3 A C F G Q R Z
4 A C F G Q R Z
5 O P
6 J O X Y
7 A P X
Maybe I do not use good term for my meaning, please see:
1 A C Z F G
2 G Q R C
record 1 has C and G common with Record 2 now 1 has not R and Q thus we must have 1 A C Z F G + Q and R and Record 2 has not A,Z and F thus we must have: 2 G Q R C + A,Z and F thus at the end we have:
1 A C Z F G Q R
2 G Q R C A Z F
I need all records Respectively in the queue from top to bottom.
wrote a delphi code but it is so slow.
Someone suggest me this groovy code:
def f=[:]
new File('Data.csv').readLines().each{
def items=it.split(',')
def name
items.eachWithIndex { String entry, int i ->
if(i==0){
name=entry
}
else if(entry){
if(!f[entry])
f[entry]=[]
f[entry]<<name
}
}
}
f.findAll {it.value.size()>1}
It is very fast (because of using a map file I think), but It only finds the common values.
If you would go for a SQL solution, then that csv data could be
put in a normalized table with the data unfolded per ID & WORD.
Once you have that, it becomes a matter of self-joining that table.
And concatinate the words back together in alphabetic order.
SqlFiddle test here
Not sure how fast this method would be on a table with 1000k records though.
But it's an interesting puzzle.
Sample data:
DROP TABLE IF EXISTS test_words;
CREATE TABLE IF NOT EXISTS test_words (
id int unsigned NOT NULL PRIMARY KEY,
words varchar(60) NOT NULL
);
INSERT INTO test_words (id, words) VALUES
(1,'A C Z F G'),
(2,'G Q R C'),
(3,'Z G Q'),
(4,'C F'),
(5,'P O'),
(6,'O X Y J'),
(7,'A P X');
Tally table with numbers:
DROP TABLE IF EXISTS tmp_numbers;
CREATE TEMPORARY TABLE IF NOT EXISTS tmp_numbers (
n int unsigned NOT NULL PRIMARY KEY
);
INSERT INTO tmp_numbers (n) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
Unfolding the words:
DROP TABLE IF EXISTS test_words_unfolded;
CREATE TABLE test_words_unfolded (
word varchar(10) NOT NULL,
id int unsigned NOT NULL,
PRIMARY KEY (word, id)
);
INSERT INTO test_words_unfolded (word, id)
SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(t.words,' ', nr.n),' ',-1) as word, t.id
FROM test_words AS t
JOIN tmp_numbers AS nr
ON CHAR_LENGTH(t.words) - CHAR_LENGTH(REPLACE(t.words,' ','')) >= nr.n - 1
AND SUBSTRING_INDEX(SUBSTRING_INDEX(t.words,' ', nr.n),' ',-1) != '';
Result table:
DROP TABLE IF EXISTS test_result;
CREATE TABLE IF NOT EXISTS test_result (
id int unsigned NOT NULL PRIMARY KEY,
words varchar(60) NOT NULL
);
INSERT INTO test_result (id, words)
SELECT q.id, GROUP_CONCAT(DISTINCT t3.word ORDER BY t3.word ASC SEPARATOR ' ') as words
FROM
(
SELECT t1.id, t2.id as id2
FROM test_words_unfolded t1
JOIN test_words_unfolded t2 ON t1.word = t2.word
GROUP BY t1.id, t2.id
HAVING COUNT(*) > 1 OR t1.id = t2.id
) q
LEFT JOIN test_words_unfolded t3 ON t3.id = q.id2
GROUP BY q.id
ORDER BY q.id;
SELECT *
FROM test_result
ORDER BY id;
Result:
id words
-- -----
1 A C F G Q R Z
2 A C F G Q R Z
3 A C F G Q R Z
4 A C F G Z
5 O P
6 J O X Y
7 A P X
Extra
To mark the words that have been added, the query to fill the result table becomes a bit more complicated.
SELECT
q2.id,
GROUP_CONCAT(DISTINCT CASE WHEN q2.ori = 1 THEN q2.word ELSE CONCAT('[',q2.word,']') END ORDER BY q2.word ASC SEPARATOR ' ') as words
FROM
(
SELECT
q1.id, t3.word,
MAX(CASE WHEN q1.id = t3.id THEN 1 ELSE 0 END) as ori
FROM
(
SELECT
t1.id, t2.id as id2
FROM test_words_unfolded t1
JOIN test_words_unfolded t2 ON t1.word = t2.word
GROUP BY t1.id, t2.id
HAVING COUNT(*) > 1 OR t1.id = t2.id
) q1
LEFT JOIN test_words_unfolded t3 ON t3.id = q1.id2
GROUP BY q1.id, t3.word
) q2
GROUP BY q2.id
ORDER BY q2.id;
Result:
id words
-- -----
1 A C F G [Q] [R] Z
2 [A] C [F] G Q R [Z]
3 [A] [C] [F] G Q [R] Z
4 [A] C F [G] [Z]
5 O P
6 J O X Y
7 A P X
Additional experiment here