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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: B = None
        self.u: A = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: B = None
        self.s: A = None
        self.txt = txt

i = A("i")
m = B("m")
d = C("d")
a = D("a")
n = E("n")
g = F("g")
e = G("e")
b = G("b")
k = C("k")
h = C("h")

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: B = None
        self.u: A = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: B = None
        self.s: A = None
        self.txt = txt

i = A("i")
m = B("m")
d = C("d")
a = D("a")
n = E("n")
g = F("g")
e = G("e")
b = G("b")
k = C("k")
h = C("h")

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