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

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

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

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

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

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

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

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

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

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

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

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

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