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

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

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

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

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

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

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

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

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

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

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