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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: G = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: J = None
        self.v: I = None
        self.s: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: G = None
        self.u: F = None
        self.z: H = None
        self.v: B = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: I = None
        self.r: C = None
        self.s: B = None
        self.w: C = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: I = None
        self.q: H = None
        self.w: I = None
        self.o: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: J = None
        self.r: G = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: J = None
        self.v: I = None
        self.s: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: G = None
        self.u: F = None
        self.z: H = None
        self.v: B = None
        self.t: C = None
        self.p: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: I = None
        self.r: C = None
        self.s: B = None
        self.w: C = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

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

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

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: I = None
        self.q: H = None
        self.w: I = None
        self.o: H = None
        self.txt = txt

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

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