class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: I = None
        self.r: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.x: C = None
        self.p: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: I = None
        self.r: A = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

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