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

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

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

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

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

i = A("i")
a = B("a")
f = C("f")
b = D("b")
d = E("d")
h = C("h")
k = A("k")
n = E("n")
j = D("j")

i.y = k
i.q = a
i.o = a
i.x = h
i.z = d
a.u = d
f.w = h
f.y = d
b.y = k
b.u = j
b.s = a
d.x = k
d.o = f
h.w = f
h.y = n
k.y = i
k.q = a
k.o = a
k.x = h
k.z = d
n.x = i
n.o = h
j.y = i
j.u = b
j.s = a
assert h.y.x.y.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: A = None
        self.q: B = None
        self.x: C = None
        self.z: E = None
        self.o: B = None
        self.txt = txt

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

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

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

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

i = A("i")
a = B("a")
f = C("f")
b = D("b")
d = E("d")
h = C("h")
k = A("k")
n = E("n")
j = D("j")

i.y = k
i.q = a
i.o = a
i.x = h
i.z = d
a.u = d
f.w = h
f.y = d
b.y = k
b.u = j
b.s = a
d.x = k
d.o = f
h.w = f
h.y = n
k.y = i
k.q = a
k.o = a
k.x = h
k.z = d
n.x = i
n.o = h
j.y = i
j.u = b
j.s = a
assert h.y.x.y.o.u.txt == "d"