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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.p: F = None
        self.r: F = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.s: C = None
        self.p: F = None
        self.r: F = None
        self.u: H = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

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

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