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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.u: C = None
        self.s: G = None
        self.v: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.p: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: C = None
        self.u: C = None
        self.s: G = None
        self.v: C = None
        self.txt = txt

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

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

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