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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: G = None
        self.s: G = None
        self.t: F = None
        self.u: H = None
        self.p: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: F = None
        self.s: E = None
        self.q: C = None
        self.p: H = None
        self.t: H = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: G = None
        self.s: G = None
        self.t: F = None
        self.u: H = None
        self.p: F = None
        self.v: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: F = None
        self.s: E = None
        self.q: C = None
        self.p: H = None
        self.t: H = None
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

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

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