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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.v: C = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

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

a = A("a")
k = B("k")
l = C("l")
e = D("e")
i = E("i")
h = E("h")

a.x = l
a.q = i
a.y = i
a.p = h
a.u = k
k.v = a
k.o = h
l.s = k
l.x = e
e.w = i
e.u = l
e.v = l
e.r = k
e.s = k
i.u = l
i.p = h
h.u = l
h.p = i
assert k.v.y.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: E = None
        self.p: E = None
        self.u: B = None
        self.y: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.u: C = None
        self.v: C = None
        self.r: B = None
        self.s: B = None
        self.txt = txt

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

a = A("a")
k = B("k")
l = C("l")
e = D("e")
i = E("i")
h = E("h")

a.x = l
a.q = i
a.y = i
a.p = h
a.u = k
k.v = a
k.o = h
l.s = k
l.x = e
e.w = i
e.u = l
e.v = l
e.r = k
e.s = k
i.u = l
i.p = h
h.u = l
h.p = i
assert k.v.y.p.u.txt == "l"