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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: E = None
        self.t: D = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.q: H = None
        self.p: B = None
        self.v: D = None
        self.w: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.x: E = None
        self.t: D = None
        self.w: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.t: B = None
        self.q: H = None
        self.p: B = None
        self.v: D = None
        self.w: A = None
        self.txt = txt

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

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

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