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

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

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

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

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

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

l.u = g
l.x = j
i.t = l
i.p = b
i.s = b
i.y = j
m.x = g
m.o = a
m.t = a
m.y = l
b.z = m
b.v = a
b.x = d
b.u = c
c.t = i
c.v = b
a.x = l
a.y = l
a.o = m
a.t = m
g.u = l
g.x = j
j.t = g
j.p = b
j.s = b
j.y = i
d.t = j
d.v = b
assert l.x.p.x.t.y.t.u.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

l.u = g
l.x = j
i.t = l
i.p = b
i.s = b
i.y = j
m.x = g
m.o = a
m.t = a
m.y = l
b.z = m
b.v = a
b.x = d
b.u = c
c.t = i
c.v = b
a.x = l
a.y = l
a.o = m
a.t = m
g.u = l
g.x = j
j.t = g
j.p = b
j.s = b
j.y = i
d.t = j
d.v = b
assert l.x.p.x.t.y.t.u.x.txt == "j"