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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: F = None
        self.s: B = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: H = None
        self.s: H = None
        self.x: B = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: E = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.p: F = None
        self.s: B = None
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.u: B = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: H = None
        self.s: H = None
        self.x: B = None
        self.v: G = None
        self.o: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: E = None
        self.x: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

l.u = g
l.q = b
m.q = h
m.p = f
m.s = a
m.u = i
b.x = m
b.u = m
b.s = h
n.r = k
n.z = i
n.s = i
n.x = m
n.v = g
n.o = a
k.z = b
f.o = m
f.x = m
f.t = k
h.w = k
i.z = b
a.q = h
a.p = f
a.s = m
a.u = i
g.w = k
assert h.w.z.s.w.z.u.p.t.z.x.txt == "m"