class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: H = None
        self.x: F = None
        self.t: C = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: C = None
        self.u: C = None
        self.s: B = None
        self.r: A = None
        self.q: C = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.y: B = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: H = None
        self.x: F = None
        self.t: C = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: C = None
        self.u: C = None
        self.s: B = None
        self.r: A = None
        self.q: C = None
        self.z: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: F = None
        self.y: B = None
        self.s: A = None
        self.txt = txt

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

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