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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

j = A("j")
b = B("b")
n = C("n")
g = D("g")
i = E("i")
e = F("e")

j.r = b
j.z = n
j.y = n
j.s = i
b.t = e
n.u = g
n.s = g
g.t = i
g.p = i
g.r = i
g.o = j
i.s = e
i.z = n
i.r = n
i.o = b
i.p = g
e.q = b
assert i.p.p.r.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: C = None
        self.y: C = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

j = A("j")
b = B("b")
n = C("n")
g = D("g")
i = E("i")
e = F("e")

j.r = b
j.z = n
j.y = n
j.s = i
b.t = e
n.u = g
n.s = g
g.t = i
g.p = i
g.r = i
g.o = j
i.s = e
i.z = n
i.r = n
i.o = b
i.p = g
e.q = b
assert i.p.p.r.u.r.txt == "i"