class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: B = None
        self.o: G = None
        self.v: G = None
        self.w: F = None
        self.q: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.x: B = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: C = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: B = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: C = None
        self.x: B = None
        self.q: D = None
        self.p: D = None
        self.txt = txt

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

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