class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.p: E = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

b.z = a
b.p = a
b.w = a
b.s = m
i.o = m
m.z = i
d.w = e
d.y = j
d.s = l
a.t = b
a.q = d
a.r = e
l.z = j
l.r = a
l.s = m
l.u = b
k.o = m
e.w = d
e.y = b
e.s = l
j.z = a
j.p = a
j.w = a
j.s = m
c.z = j
c.u = j
c.r = a
c.s = m
assert a.q.w.w.s.r.t.z.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.p: E = None
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: D = None
        self.y: A = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.s: C = None
        self.u: A = None
        self.txt = txt

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

b.z = a
b.p = a
b.w = a
b.s = m
i.o = m
m.z = i
d.w = e
d.y = j
d.s = l
a.t = b
a.q = d
a.r = e
l.z = j
l.r = a
l.s = m
l.u = b
k.o = m
e.w = d
e.y = b
e.s = l
j.z = a
j.p = a
j.w = a
j.s = m
c.z = j
c.u = j
c.r = a
c.s = m
assert a.q.w.w.s.r.t.z.t.p.txt == "a"