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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.r: C = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

l.q = i
h.p = e
h.o = e
h.u = l
a.s = g
n.y = j
g.x = m
g.v = e
g.r = i
g.o = i
g.u = h
i.s = m
m.x = g
m.v = l
m.r = a
m.o = i
m.u = h
j.y = n
e.q = i
assert h.u.q.s.o.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.r: C = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

l.q = i
h.p = e
h.o = e
h.u = l
a.s = g
n.y = j
g.x = m
g.v = e
g.r = i
g.o = i
g.u = h
i.s = m
m.x = g
m.v = l
m.r = a
m.o = i
m.u = h
j.y = n
e.q = i
assert h.u.q.s.o.s.v.txt == "l"