class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.o: J = None
        self.z: I = None
        self.r: J = None
        self.y: E = None
        self.p: H = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: G = None
        self.z: G = None
        self.w: B = None
        self.u: A = None
        self.s: I = None
        self.v: A = None
        self.q: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: F = None
        self.o: J = None
        self.z: I = None
        self.r: J = None
        self.y: E = None
        self.p: H = None
        self.s: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: G = None
        self.t: I = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.t: G = None
        self.z: G = None
        self.w: B = None
        self.u: A = None
        self.s: I = None
        self.v: A = None
        self.q: H = None
        self.r: F = None
        self.txt = txt

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

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

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

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

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

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

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