class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: D = None
        self.p: C = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: B = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.s: D = None
        self.o: A = None
        self.u: B = None
        self.txt = txt

l = A("l")
g = B("g")
j = C("j")
i = D("i")
b = E("b")
k = F("k")
c = G("c")
e = H("e")
h = F("h")

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

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.y: B = None
        self.p: D = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: A = None
        self.s: D = None
        self.o: A = None
        self.u: B = None
        self.txt = txt

l = A("l")
g = B("g")
j = C("j")
i = D("i")
b = E("b")
k = F("k")
c = G("c")
e = H("e")
h = F("h")

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