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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: F = None
        self.x: F = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
e = D("e")
i = E("i")
j = F("j")
c = G("c")
k = H("k")

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.u: F = None
        self.x: F = None
        self.v: E = None
        self.o: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: C = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
e = D("e")
i = E("i")
j = F("j")
c = G("c")
k = H("k")

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