class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.o: C = None
        self.x: G = None
        self.t: C = None
        self.s: I = None
        self.v: F = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.t: A = None
        self.u: G = None
        self.q: I = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.s: F = None
        self.q: A = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: G = None
        self.r: C = None
        self.p: H = None
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.v: E = None
        self.q: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.r: G = None
        self.t: A = None
        self.u: G = None
        self.q: I = None
        self.y: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: D = None
        self.s: F = None
        self.q: A = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: C = None
        self.z: G = None
        self.r: C = None
        self.p: H = None
        self.o: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

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