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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: A = None
        self.s: D = None
        self.v: B = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: H = None
        self.r: I = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.s: C = None
        self.v: D = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: A = None
        self.s: D = None
        self.v: B = None
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: J = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: H = None
        self.r: I = None
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: D = None
        self.s: C = None
        self.v: D = None
        self.p: H = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: D = None
        self.p: E = None
        self.txt = txt

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

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

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