class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: C = None
        self.x: C = None
        self.p: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

c.t = i
c.y = j
c.x = j
c.p = j
c.w = f
i.u = j
i.t = b
j.p = e
j.v = e
j.r = i
j.x = c
j.s = c
e.s = j
e.z = f
f.x = j
f.q = j
f.t = e
f.o = i
b.s = j
b.z = f
assert i.u.x.p.txt == "j"