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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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