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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: A = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: A = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.q: B = None
        self.txt = txt

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

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