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

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

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

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

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

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

b.r = d
b.u = d
b.y = c
l.r = b
l.t = e
m.y = f
m.o = f
m.p = c
m.x = g
f.q = g
f.p = b
f.z = d
g.o = j
g.q = c
g.p = m
d.q = g
d.p = b
d.z = f
c.r = b
c.t = m
j.o = g
j.q = c
j.p = m
e.y = f
e.o = f
e.p = l
e.x = g
assert l.r.u.p.y.t.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

b.r = d
b.u = d
b.y = c
l.r = b
l.t = e
m.y = f
m.o = f
m.p = c
m.x = g
f.q = g
f.p = b
f.z = d
g.o = j
g.q = c
g.p = m
d.q = g
d.p = b
d.z = f
c.r = b
c.t = m
j.o = g
j.q = c
j.p = m
e.y = f
e.o = f
e.p = l
e.x = g
assert l.r.u.p.y.t.o.p.txt == "b"