class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: C = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.w: H = None
        self.z: E = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: C = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

l.q = e
l.v = g
l.t = b
l.x = b
i.o = l
g.o = a
g.y = a
g.z = a
g.w = e
g.v = c
b.q = e
b.t = e
b.v = i
b.u = k
b.x = l
b.r = a
a.x = e
a.w = e
a.y = g
k.r = g
c.v = i
e.u = l
assert k.r.o.w.u.v.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.v: C = None
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: E = None
        self.w: H = None
        self.z: E = None
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: C = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

l.q = e
l.v = g
l.t = b
l.x = b
i.o = l
g.o = a
g.y = a
g.z = a
g.w = e
g.v = c
b.q = e
b.t = e
b.v = i
b.u = k
b.x = l
b.r = a
a.x = e
a.w = e
a.y = g
k.r = g
c.v = i
e.u = l
assert k.r.o.w.u.v.w.u.txt == "l"