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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.q: F = None
        self.v: A = None
        self.t: F = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

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

h = A("h")
b = B("b")
k = C("k")
f = D("f")
d = E("d")
e = F("e")
n = G("n")
l = F("l")
g = E("g")
a = D("a")

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: B = None
        self.q: F = None
        self.v: A = None
        self.t: F = None
        self.u: A = None
        self.y: D = None
        self.txt = txt

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

h = A("h")
b = B("b")
k = C("k")
f = D("f")
d = E("d")
e = F("e")
n = G("n")
l = F("l")
g = E("g")
a = D("a")

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