class A:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: C = None
        self.x: C = None
        self.v: B = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: C = None
        self.x: D = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: I = None
        self.y: H = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.x: H = None
        self.y: A = None
        self.q: D = None
        self.z: I = None
        self.t: C = None
        self.p: G = None
        self.v: J = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: C = None
        self.x: D = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: I = None
        self.y: H = None
        self.v: G = None
        self.w: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: C = None
        self.w: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.x: H = None
        self.y: A = None
        self.q: D = None
        self.z: I = None
        self.t: C = None
        self.p: G = None
        self.v: J = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: C = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.z: C = None
        self.o: E = None
        self.txt = txt

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

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