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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: A = None
        self.s: J = None
        self.x: D = None
        self.t: I = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.v: I = None
        self.u: G = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: B = None
        self.y: A = None
        self.p: H = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.q: G = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: H = None
        self.p: G = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: I = None
        self.o: A = None
        self.s: J = None
        self.x: D = None
        self.t: I = None
        self.u: J = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.q: C = None
        self.v: I = None
        self.u: G = None
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: B = None
        self.y: A = None
        self.p: H = None
        self.o: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.q: G = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: H = None
        self.p: G = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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