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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: G = None
        self.z: A = None
        self.u: H = None
        self.v: C = None
        self.q: A = None
        self.x: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.x: H = None
        self.s: H = None
        self.t: G = None
        self.u: G = None
        self.txt = txt

m = A("m")
c = B("c")
f = C("f")
l = D("l")
d = E("d")
g = F("g")
i = G("i")
e = H("e")
j = I("j")
n = J("n")

m.z = l
m.x = i
m.t = f
c.r = i
c.p = i
c.z = m
c.q = m
c.u = e
c.v = f
c.x = n
f.x = d
f.z = d
f.u = d
f.s = d
f.t = i
f.q = m
f.w = l
f.p = n
f.o = e
f.r = j
l.p = d
l.t = i
l.r = n
d.s = l
d.w = g
g.q = l
i.v = n
i.z = n
e.x = d
e.v = i
j.y = n
n.w = g
n.p = m
n.x = e
n.s = e
n.t = i
n.u = i
assert f.t.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: G = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: G = None
        self.z: A = None
        self.u: H = None
        self.v: C = None
        self.q: A = None
        self.x: J = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: A = None
        self.x: H = None
        self.s: H = None
        self.t: G = None
        self.u: G = None
        self.txt = txt

m = A("m")
c = B("c")
f = C("f")
l = D("l")
d = E("d")
g = F("g")
i = G("i")
e = H("e")
j = I("j")
n = J("n")

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