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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: A = None
        self.y: A = None
        self.r: C = None
        self.v: D = None
        self.p: H = None
        self.q: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: F = None
        self.s: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: A = None
        self.y: A = None
        self.r: C = None
        self.v: D = None
        self.p: H = None
        self.q: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.v: A = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: F = None
        self.s: B = None
        self.txt = txt

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

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