class A:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

i.z = m
i.w = h
i.s = b
j.o = f
j.y = k
f.y = h
f.q = h
f.v = n
d.x = e
d.p = j
d.w = j
k.y = e
k.q = m
k.v = n
n.x = i
n.p = j
n.w = j
b.o = k
b.y = f
m.z = e
m.w = i
m.s = j
e.z = h
e.w = h
e.s = j
h.z = i
h.w = e
h.s = b
assert b.o.q.w.z.w.z.s.y.y.txt == "e"