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

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.v: B = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

c = A("c")
a = B("a")
j = C("j")
g = D("g")
d = E("d")
f = B("f")
l = C("l")
b = E("b")

c.t = d
c.o = g
a.s = d
a.p = j
a.u = f
a.z = g
j.u = l
j.w = a
j.v = a
j.x = a
j.p = c
g.t = a
g.q = d
d.r = b
d.s = b
d.v = b
d.p = c
f.s = d
f.p = j
f.u = a
f.z = g
l.u = j
l.w = a
l.v = f
l.x = f
l.p = c
b.r = d
b.s = d
b.v = d
b.p = c
assert j.p.t.p.t.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: B = None
        self.v: B = None
        self.p: A = None
        self.x: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: E = None
        self.v: E = None
        self.p: A = None
        self.txt = txt

c = A("c")
a = B("a")
j = C("j")
g = D("g")
d = E("d")
f = B("f")
l = C("l")
b = E("b")

c.t = d
c.o = g
a.s = d
a.p = j
a.u = f
a.z = g
j.u = l
j.w = a
j.v = a
j.x = a
j.p = c
g.t = a
g.q = d
d.r = b
d.s = b
d.v = b
d.p = c
f.s = d
f.p = j
f.u = a
f.z = g
l.u = j
l.w = a
l.v = f
l.x = f
l.p = c
b.r = d
b.s = d
b.v = d
b.p = c
assert j.p.t.p.t.p.o.txt == "g"