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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: E = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

k = A("k")
b = B("b")
a = C("a")
c = D("c")
n = E("n")
f = F("f")
e = D("e")

k.z = e
k.q = a
b.p = k
b.z = k
b.v = n
b.y = n
b.s = e
b.q = a
a.u = f
a.r = f
a.y = n
a.w = k
c.o = k
c.u = n
c.p = a
c.t = b
n.r = a
n.w = f
f.r = k
f.w = n
f.y = n
f.p = n
e.o = k
e.u = n
e.p = a
e.t = b
assert e.u.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: E = None
        self.y: E = None
        self.p: E = None
        self.txt = txt

k = A("k")
b = B("b")
a = C("a")
c = D("c")
n = E("n")
f = F("f")
e = D("e")

k.z = e
k.q = a
b.p = k
b.z = k
b.v = n
b.y = n
b.s = e
b.q = a
a.u = f
a.r = f
a.y = n
a.w = k
c.o = k
c.u = n
c.p = a
c.t = b
n.r = a
n.w = f
f.r = k
f.w = n
f.y = n
f.p = n
e.o = k
e.u = n
e.p = a
e.t = b
assert e.u.w.p.txt == "n"