class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

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

h = A("h")
g = B("g")
i = C("i")
b = D("b")
d = E("d")
l = A("l")
n = C("n")
e = C("e")

h.w = d
h.x = d
h.p = g
g.o = d
i.u = n
b.t = i
b.z = i
b.q = e
d.u = g
d.o = b
d.w = h
d.r = h
l.w = d
l.x = d
l.p = g
n.u = i
e.u = n
assert i.u.u.u.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.x: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.z: C = None
        self.txt = txt

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

h = A("h")
g = B("g")
i = C("i")
b = D("b")
d = E("d")
l = A("l")
n = C("n")
e = C("e")

h.w = d
h.x = d
h.p = g
g.o = d
i.u = n
b.t = i
b.z = i
b.q = e
d.u = g
d.o = b
d.w = h
d.r = h
l.w = d
l.x = d
l.p = g
n.u = i
e.u = n
assert i.u.u.u.u.u.u.u.u.txt == "i"