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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: G = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.u: B = None
        self.s: E = None
        self.v: G = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: G = None
        self.z: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.u: B = None
        self.s: E = None
        self.v: G = None
        self.p: A = None
        self.x: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: F = None
        self.x: A = None
        self.txt = txt

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

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

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