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

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

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

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

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

f = A("f")
h = B("h")
i = C("i")
a = D("a")
e = E("e")
j = C("j")
d = E("d")
m = A("m")
n = C("n")

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

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

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

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

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

f = A("f")
h = B("h")
i = C("i")
a = D("a")
e = E("e")
j = C("j")
d = E("d")
m = A("m")
n = C("n")

f.r = j
f.q = j
f.u = j
f.o = e
f.y = m
h.u = e
h.x = e
h.q = a
h.s = a
h.p = n
i.v = h
a.w = n
a.s = m
a.v = h
e.z = f
e.q = d
e.x = a
j.v = h
d.z = m
d.q = e
d.x = a
m.r = i
m.q = j
m.u = j
m.o = d
m.y = f
n.v = h
assert h.p.v.x.q.x.s.o.txt == "d"