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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.v: B = None
        self.r: A = None
        self.p: C = None
        self.t: C = None
        self.x: B = None
        self.z: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.p: B = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

k = A("k")
f = B("f")
a = C("a")
c = D("c")
m = E("m")
i = F("i")
g = G("g")
b = H("b")
n = B("n")
e = A("e")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.o: D = None
        self.v: B = None
        self.r: A = None
        self.p: C = None
        self.t: C = None
        self.x: B = None
        self.z: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: D = None
        self.p: B = None
        self.y: H = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

k = A("k")
f = B("f")
a = C("a")
c = D("c")
m = E("m")
i = F("i")
g = G("g")
b = H("b")
n = B("n")
e = A("e")

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