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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.t: E = None
        self.u: F = None
        self.z: D = None
        self.q: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: C = None
        self.y: H = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.y: B = None
        self.o: C = None
        self.p: F = None
        self.x: A = None
        self.txt = txt

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

m = A("m")
e = B("e")
k = C("k")
g = D("g")
i = E("i")
l = F("l")
f = G("f")
b = H("b")
d = F("d")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.s: E = None
        self.t: E = None
        self.u: F = None
        self.z: D = None
        self.q: E = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.p: C = None
        self.y: H = None
        self.o: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: A = None
        self.y: B = None
        self.o: C = None
        self.p: F = None
        self.x: A = None
        self.txt = txt

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

m = A("m")
e = B("e")
k = C("k")
g = D("g")
i = E("i")
l = F("l")
f = G("f")
b = H("b")
d = F("d")
a = F("a")

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