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

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

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

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

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

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

e = A("e")
f = B("f")
i = C("i")
c = D("c")
j = E("j")
d = F("d")
k = E("k")

e.t = f
f.z = i
f.u = i
f.r = e
f.p = d
f.t = c
f.s = j
i.p = f
c.u = j
c.z = j
c.r = i
j.r = d
j.t = d
j.q = d
j.p = e
j.y = f
d.z = j
d.x = k
k.r = d
k.t = d
k.q = d
k.p = e
k.y = f
assert f.r.t.r.t.r.t.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

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

e = A("e")
f = B("f")
i = C("i")
c = D("c")
j = E("j")
d = F("d")
k = E("k")

e.t = f
f.z = i
f.u = i
f.r = e
f.p = d
f.t = c
f.s = j
i.p = f
c.u = j
c.z = j
c.r = i
j.r = d
j.t = d
j.q = d
j.p = e
j.y = f
d.z = j
d.x = k
k.r = d
k.t = d
k.q = d
k.p = e
k.y = f
assert f.r.t.r.t.r.t.z.txt == "i"