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

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

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

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

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

e = A("e")
l = B("l")
h = C("h")
n = D("n")
f = E("f")
d = D("d")
c = B("c")
m = B("m")

e.y = h
e.v = h
e.o = f
e.x = f
e.u = m
l.u = e
h.y = e
n.t = f
f.q = h
d.t = f
c.u = e
m.u = e
assert e.x.q.y.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: E = None
        self.u: B = None
        self.v: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

e = A("e")
l = B("l")
h = C("h")
n = D("n")
f = E("f")
d = D("d")
c = B("c")
m = B("m")

e.y = h
e.v = h
e.o = f
e.x = f
e.u = m
l.u = e
h.y = e
n.t = f
f.q = h
d.t = f
c.u = e
m.u = e
assert e.x.q.y.u.u.txt == "e"