class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: I = None
        self.s: I = None
        self.z: B = None
        self.o: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: B = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: F = None
        self.y: D = None
        self.u: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: A = None
        self.u: A = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: A = None
        self.r: A = None
        self.y: C = None
        self.x: F = None
        self.txt = txt

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

i = A("i")
a = B("a")
g = C("g")
h = D("h")
m = E("m")
k = F("k")
n = G("n")
c = H("c")
b = I("b")
l = G("l")

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.p: B = None
        self.v: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.q: F = None
        self.y: D = None
        self.u: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: I = None
        self.v: A = None
        self.u: A = None
        self.s: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: I = None
        self.p: A = None
        self.r: A = None
        self.y: C = None
        self.x: F = None
        self.txt = txt

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

i = A("i")
a = B("a")
g = C("g")
h = D("h")
m = E("m")
k = F("k")
n = G("n")
c = H("c")
b = I("b")
l = G("l")

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