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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: F = None
        self.s: E = None
        self.o: I = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.w: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.y: B = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.v: F = None
        self.s: E = None
        self.o: I = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: B = None
        self.w: F = None
        self.txt = txt

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

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

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