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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: E = None
        self.p: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.t: B = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.p: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: E = None
        self.p: F = None
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.p: F = None
        self.t: B = None
        self.o: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.p: H = None
        self.txt = txt

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

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

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

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