class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: A = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.x: F = None
        self.z: B = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.s: A = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

l = A("l")
i = B("i")
m = C("m")
e = D("e")
d = E("d")
a = F("a")
h = G("h")
g = A("g")
c = D("c")

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: D = None
        self.x: F = None
        self.z: B = None
        self.r: E = None
        self.s: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.u: D = None
        self.s: A = None
        self.w: D = None
        self.x: E = None
        self.txt = txt

l = A("l")
i = B("i")
m = C("m")
e = D("e")
d = E("d")
a = F("a")
h = G("h")
g = A("g")
c = D("c")

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