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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

d = A("d")
j = B("j")
h = C("h")
e = D("e")
i = A("i")
a = C("a")

d.w = e
d.o = i
d.t = h
d.p = h
j.v = i
j.q = h
j.y = e
j.z = d
h.u = a
h.o = e
h.y = j
e.z = a
i.w = e
i.o = d
i.t = h
i.p = h
a.u = h
a.o = e
a.y = j
assert i.w.z.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.o: A = None
        self.t: C = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.y: D = None
        self.z: A = None
        self.txt = txt

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

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

d = A("d")
j = B("j")
h = C("h")
e = D("e")
i = A("i")
a = C("a")

d.w = e
d.o = i
d.t = h
d.p = h
j.v = i
j.q = h
j.y = e
j.z = d
h.u = a
h.o = e
h.y = j
e.z = a
i.w = e
i.o = d
i.t = h
i.p = h
a.u = h
a.o = e
a.y = j
assert i.w.z.u.txt == "h"