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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.o: H = None
        self.s: C = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.u: B = None
        self.v: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.z: E = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: A = None
        self.o: H = None
        self.s: C = None
        self.q: C = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: C = None
        self.u: B = None
        self.v: D = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.z: E = None
        self.y: A = None
        self.u: F = None
        self.txt = txt

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

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

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