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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.s: A = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.s: A = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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