class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: I = None
        self.p: I = None
        self.y: H = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: E = None
        self.r: I = None
        self.w: I = None
        self.q: D = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: J = None
        self.y: E = None
        self.r: I = None
        self.w: I = None
        self.q: D = None
        self.v: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.y: D = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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