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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.z: A = None
        self.v: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

n = A("n")
k = B("k")
e = C("e")
g = D("g")
d = E("d")
a = F("a")
f = G("f")
l = H("l")
h = D("h")

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.r: D = None
        self.y: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: F = None
        self.z: A = None
        self.v: B = None
        self.o: D = None
        self.txt = txt

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

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

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

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

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

n = A("n")
k = B("k")
e = C("e")
g = D("g")
d = E("d")
a = F("a")
f = G("f")
l = H("l")
h = D("h")

n.w = a
k.x = f
k.y = f
k.r = h
e.q = k
e.v = k
e.t = a
e.z = n
e.o = h
g.q = e
g.v = d
d.q = f
d.t = k
a.r = d
a.y = d
a.w = f
f.v = k
f.s = d
f.o = l
f.w = e
f.r = g
l.o = f
h.q = e
h.v = d
assert e.t.w.o.o.o.o.o.txt == "l"