class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.s: E = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.y: B = None
        self.q: B = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.x: C = None
        self.txt = txt

c = A("c")
d = B("d")
l = C("l")
n = D("n")
e = E("e")
g = F("g")
i = A("i")
f = C("f")
h = D("h")
k = E("k")

c.y = i
c.z = k
c.s = k
c.x = g
c.q = f
d.y = e
d.p = e
l.z = n
l.s = e
l.y = d
l.q = d
l.r = c
l.w = f
n.z = c
e.x = k
e.p = g
e.y = n
g.z = h
g.u = n
g.x = f
i.y = c
i.z = e
i.s = e
i.x = g
i.q = l
f.z = n
f.s = e
f.y = d
f.q = d
f.r = c
f.w = l
h.z = i
k.x = e
k.p = g
k.y = n
assert f.s.x.p.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: E = None
        self.s: E = None
        self.x: F = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: E = None
        self.y: B = None
        self.q: B = None
        self.r: A = None
        self.w: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: F = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: D = None
        self.x: C = None
        self.txt = txt

c = A("c")
d = B("d")
l = C("l")
n = D("n")
e = E("e")
g = F("g")
i = A("i")
f = C("f")
h = D("h")
k = E("k")

c.y = i
c.z = k
c.s = k
c.x = g
c.q = f
d.y = e
d.p = e
l.z = n
l.s = e
l.y = d
l.q = d
l.r = c
l.w = f
n.z = c
e.x = k
e.p = g
e.y = n
g.z = h
g.u = n
g.x = f
i.y = c
i.z = e
i.s = e
i.x = g
i.q = l
f.z = n
f.s = e
f.y = d
f.q = d
f.r = c
f.w = l
h.z = i
k.x = e
k.p = g
k.y = n
assert f.s.x.p.u.z.txt == "c"