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

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.p: B = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
k = C("k")
a = D("a")
d = E("d")
h = C("h")
n = D("n")
i = D("i")

g.t = h
g.o = h
l.u = a
l.r = g
l.x = g
k.z = h
k.t = h
k.v = g
k.p = l
k.w = i
a.y = k
a.r = k
a.x = i
a.t = l
d.y = l
h.z = k
h.t = k
h.v = g
h.p = l
h.w = a
n.y = k
n.r = k
n.x = a
n.t = l
i.y = k
i.r = k
i.x = n
i.t = l
assert i.t.u.r.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: C = None
        self.v: A = None
        self.p: B = None
        self.w: D = None
        self.t: C = None
        self.txt = txt

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

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

g = A("g")
l = B("l")
k = C("k")
a = D("a")
d = E("d")
h = C("h")
n = D("n")
i = D("i")

g.t = h
g.o = h
l.u = a
l.r = g
l.x = g
k.z = h
k.t = h
k.v = g
k.p = l
k.w = i
a.y = k
a.r = k
a.x = i
a.t = l
d.y = l
h.z = k
h.t = k
h.v = g
h.p = l
h.w = a
n.y = k
n.r = k
n.x = a
n.t = l
i.y = k
i.r = k
i.x = n
i.t = l
assert i.t.u.r.p.u.txt == "a"