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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: A = None
        self.s: G = None
        self.u: B = None
        self.o: B = None
        self.t: I = None
        self.x: I = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: E = None
        self.u: F = None
        self.q: I = None
        self.o: H = None
        self.v: D = None
        self.r: H = None
        self.t: I = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: F = None
        self.o: I = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: A = None
        self.s: G = None
        self.u: B = None
        self.o: B = None
        self.t: I = None
        self.x: I = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.w: E = None
        self.u: F = None
        self.q: I = None
        self.o: H = None
        self.v: D = None
        self.r: H = None
        self.t: I = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: F = None
        self.o: I = None
        self.txt = txt

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

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

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