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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.z: D = None
        self.u: E = None
        self.v: F = None
        self.y: F = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: D = None
        self.q: F = None
        self.u: H = None
        self.y: C = None
        self.z: H = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: G = None
        self.z: D = None
        self.u: E = None
        self.v: F = None
        self.y: F = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.o: D = None
        self.q: F = None
        self.u: H = None
        self.y: C = None
        self.z: H = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

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

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