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

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

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

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

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

i = A("i")
j = B("j")
f = C("f")
a = D("a")
n = E("n")
c = B("c")
e = D("e")

i.r = c
i.t = f
j.z = i
j.x = i
j.u = f
j.t = f
j.p = e
f.t = n
a.t = i
a.z = n
n.t = f
n.x = f
c.z = i
c.x = i
c.u = f
c.t = f
c.p = e
e.t = i
e.z = n
assert i.t.t.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

i = A("i")
j = B("j")
f = C("f")
a = D("a")
n = E("n")
c = B("c")
e = D("e")

i.r = c
i.t = f
j.z = i
j.x = i
j.u = f
j.t = f
j.p = e
f.t = n
a.t = i
a.z = n
n.t = f
n.x = f
c.z = i
c.x = i
c.u = f
c.t = f
c.p = e
e.t = i
e.z = n
assert i.t.t.x.t.txt == "n"