class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: A = None
        self.x: I = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.s: D = None
        self.x: F = None
        self.q: H = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: I = None
        self.u: B = None
        self.x: G = None
        self.w: I = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.y: D = None
        self.p: C = None
        self.w: B = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.w: D = None
        self.p: E = None
        self.txt = txt

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

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

m.p = a
m.v = l
k.v = f
k.o = m
k.x = g
k.y = b
c.w = k
c.t = k
c.s = l
c.y = l
c.x = a
c.q = f
c.o = m
l.p = f
n.o = k
n.u = k
n.v = g
n.w = g
n.x = b
n.s = b
a.t = g
b.o = a
b.v = a
b.q = n
b.z = n
b.y = l
b.p = c
b.w = k
f.t = m
f.y = m
f.w = l
f.p = n
g.q = a
g.p = f
assert m.p.t.q.t.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: A = None
        self.x: I = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.s: D = None
        self.x: F = None
        self.q: H = None
        self.o: A = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: I = None
        self.u: B = None
        self.x: G = None
        self.w: I = None
        self.s: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: E = None
        self.y: D = None
        self.p: C = None
        self.w: B = None
        self.z: E = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: A = None
        self.w: D = None
        self.p: E = None
        self.txt = txt

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

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

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