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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.t: D = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

i.o = e
i.q = f
i.u = f
i.x = m
l.w = d
l.t = d
l.q = k
l.p = b
l.u = a
d.r = m
d.x = l
k.z = a
b.v = l
b.q = l
b.t = k
b.y = e
b.u = d
m.r = d
m.x = l
f.v = l
f.q = l
f.t = k
f.y = e
f.u = d
a.o = e
a.q = h
a.u = b
a.x = d
e.o = a
e.q = b
e.u = b
e.x = d
h.v = l
h.q = l
h.t = k
h.y = i
h.u = m
assert l.p.v.w.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: E = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: B = None
        self.t: D = None
        self.y: A = None
        self.u: C = None
        self.txt = txt

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

i.o = e
i.q = f
i.u = f
i.x = m
l.w = d
l.t = d
l.q = k
l.p = b
l.u = a
d.r = m
d.x = l
k.z = a
b.v = l
b.q = l
b.t = k
b.y = e
b.u = d
m.r = d
m.x = l
f.v = l
f.q = l
f.t = k
f.y = e
f.u = d
a.o = e
a.q = h
a.u = b
a.x = d
e.o = a
e.q = b
e.u = b
e.x = d
h.v = l
h.q = l
h.t = k
h.y = i
h.u = m
assert l.p.v.w.r.r.txt == "d"