class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.z: A = None
        self.q: A = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.r: D = None
        self.u: A = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.u: F = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: C = None
        self.txt = txt

i = A("i")
c = B("c")
m = C("m")
j = D("j")
n = E("n")
g = F("g")
a = A("a")
l = E("l")
e = E("e")
d = E("d")

i.p = c
i.v = c
i.z = a
i.q = a
i.w = a
c.y = i
c.u = i
c.q = m
c.r = j
c.t = j
m.v = c
m.x = c
m.z = g
j.o = m
n.y = m
n.v = c
n.u = g
n.o = i
n.t = d
g.t = m
g.p = m
a.p = c
a.v = c
a.z = i
a.q = i
a.w = i
l.y = m
l.v = c
l.u = g
l.o = a
l.t = d
e.y = m
e.v = c
e.u = g
e.o = i
e.t = l
d.y = m
d.v = c
d.u = g
d.o = a
d.t = l
assert i.p.q.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: B = None
        self.z: A = None
        self.q: A = None
        self.w: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: C = None
        self.r: D = None
        self.u: A = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.u: F = None
        self.o: A = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.p: C = None
        self.txt = txt

i = A("i")
c = B("c")
m = C("m")
j = D("j")
n = E("n")
g = F("g")
a = A("a")
l = E("l")
e = E("e")
d = E("d")

i.p = c
i.v = c
i.z = a
i.q = a
i.w = a
c.y = i
c.u = i
c.q = m
c.r = j
c.t = j
m.v = c
m.x = c
m.z = g
j.o = m
n.y = m
n.v = c
n.u = g
n.o = i
n.t = d
g.t = m
g.p = m
a.p = c
a.v = c
a.z = i
a.q = i
a.w = i
l.y = m
l.v = c
l.u = g
l.o = a
l.t = d
e.y = m
e.v = c
e.u = g
e.o = i
e.t = l
d.y = m
d.v = c
d.u = g
d.o = a
d.t = l
assert i.p.q.z.p.txt == "m"