class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

h.s = f
h.p = g
h.y = i
h.r = i
e.t = j
e.s = f
e.z = h
a.p = i
a.u = i
b.z = g
b.w = a
b.u = f
b.r = k
j.t = k
j.s = h
j.z = f
n.s = h
n.p = b
n.y = i
n.r = i
g.z = b
g.w = a
g.u = f
g.r = e
i.p = a
i.u = a
f.s = h
f.p = b
f.y = i
f.r = a
k.t = j
k.s = h
k.z = f
assert i.p.p.u.p.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.y: C = None
        self.r: C = None
        self.txt = txt

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

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

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

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

h.s = f
h.p = g
h.y = i
h.r = i
e.t = j
e.s = f
e.z = h
a.p = i
a.u = i
b.z = g
b.w = a
b.u = f
b.r = k
j.t = k
j.s = h
j.z = f
n.s = h
n.p = b
n.y = i
n.r = i
g.z = b
g.w = a
g.u = f
g.r = e
i.p = a
i.u = a
f.s = h
f.p = b
f.y = i
f.r = a
k.t = j
k.s = h
k.z = f
assert i.p.p.u.p.u.u.txt == "i"