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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: H = None
        self.t: F = None
        self.p: B = None
        self.o: D = None
        self.r: H = None
        self.y: B = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: I = None
        self.x: C = None
        self.q: A = None
        self.z: E = None
        self.p: E = None
        self.y: I = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: H = None
        self.t: F = None
        self.p: B = None
        self.o: D = None
        self.r: H = None
        self.y: B = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: I = None
        self.x: C = None
        self.q: A = None
        self.z: E = None
        self.p: E = None
        self.y: I = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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