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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.y: D = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

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

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

i.w = d
i.u = h
d.y = i
d.u = i
d.w = n
d.t = h
f.x = d
f.p = d
f.o = n
f.u = n
f.w = i
a.r = h
a.z = m
a.y = n
a.x = d
a.p = d
l.w = m
l.u = m
l.p = i
l.r = f
l.s = g
n.r = i
n.z = g
n.y = a
n.x = d
n.p = d
m.w = g
m.s = g
m.p = h
m.r = f
m.u = l
h.w = d
h.u = i
g.w = m
g.u = m
g.p = h
g.r = k
g.s = l
k.x = d
k.p = d
k.o = a
k.u = n
k.w = h
assert g.s.p.w.t.w.u.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.z: E = None
        self.y: D = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

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

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

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