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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: F = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

k = A("k")
l = B("l")
d = C("d")
i = D("i")
m = E("m")
f = F("f")
j = G("j")
e = H("e")

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: F = None
        self.p: A = None
        self.y: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

k = A("k")
l = B("l")
d = C("d")
i = D("i")
m = E("m")
f = F("f")
j = G("j")
e = H("e")

k.x = i
k.w = j
k.q = f
l.p = k
l.u = e
l.q = j
d.s = m
i.x = j
i.u = f
i.p = k
i.y = k
m.s = i
f.r = i
f.s = d
f.q = e
j.p = e
j.w = e
j.o = l
j.r = d
j.z = m
j.v = m
e.o = j
e.u = j
e.p = k
e.v = d
assert e.v.s.s.u.s.s.txt == "m"