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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.u: B = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

i = A("i")
k = B("k")
f = C("f")
c = D("c")
a = E("a")
g = F("g")

i.z = k
i.q = k
i.p = f
i.y = f
i.s = a
k.t = a
f.z = k
f.r = g
f.s = g
f.p = i
f.q = c
c.x = i
c.w = g
c.z = a
c.u = a
a.t = c
g.q = a
g.o = a
g.t = k
g.u = k
g.w = c
assert a.t.w.o.t.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.q: B = None
        self.p: C = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.t: B = None
        self.u: B = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

i = A("i")
k = B("k")
f = C("f")
c = D("c")
a = E("a")
g = F("g")

i.z = k
i.q = k
i.p = f
i.y = f
i.s = a
k.t = a
f.z = k
f.r = g
f.s = g
f.p = i
f.q = c
c.x = i
c.w = g
c.z = a
c.u = a
a.t = c
g.q = a
g.o = a
g.t = k
g.u = k
g.w = c
assert a.t.w.o.t.z.t.txt == "c"