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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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