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

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
n = D("n")
a = E("a")
m = C("m")
e = C("e")
h = D("h")

l.r = k
g.u = h
k.y = g
k.s = g
k.z = g
k.u = e
n.y = g
n.o = a
a.p = l
a.t = l
a.z = h
m.y = g
m.s = g
m.z = g
m.u = k
e.y = g
e.s = g
e.z = g
e.u = k
h.y = g
h.o = a
assert l.r.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

l = A("l")
g = B("g")
k = C("k")
n = D("n")
a = E("a")
m = C("m")
e = C("e")
h = D("h")

l.r = k
g.u = h
k.y = g
k.s = g
k.z = g
k.u = e
n.y = g
n.o = a
a.p = l
a.t = l
a.z = h
m.y = g
m.s = g
m.z = g
m.u = k
e.y = g
e.s = g
e.z = g
e.u = k
h.y = g
h.o = a
assert l.r.y.u.txt == "h"