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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: F = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

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