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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: C = None
        self.u: C = None
        self.w: F = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: F = None
        self.p: H = None
        self.v: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: J = None
        self.r: C = None
        self.u: C = None
        self.w: F = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.w: I = None
        self.t: F = None
        self.p: H = None
        self.v: C = None
        self.txt = txt

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

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