class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.s: B = None
        self.v: B = None
        self.x: E = None
        self.p: F = None
        self.z: H = None
        self.w: H = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.x: D = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.w: A = None
        self.p: G = None
        self.x: A = None
        self.u: G = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

i = A("i")
a = B("a")
h = C("h")
j = D("j")
l = E("l")
e = F("e")
g = G("g")
m = H("m")
n = F("n")
d = C("d")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: F = None
        self.x: D = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: C = None
        self.w: A = None
        self.p: G = None
        self.x: A = None
        self.u: G = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

i = A("i")
a = B("a")
h = C("h")
j = D("j")
l = E("l")
e = F("e")
g = G("g")
m = H("m")
n = F("n")
d = C("d")

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