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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.txt = txt

a = A("a")
l = B("l")
h = C("h")
b = D("b")
n = E("n")
j = F("j")
m = A("m")
f = B("f")
c = F("c")
e = D("e")

a.s = n
l.t = j
l.p = h
h.y = j
h.x = f
h.o = a
b.o = j
b.s = a
n.s = m
n.o = m
n.x = h
n.v = h
n.w = e
j.t = l
j.z = b
m.s = n
f.t = c
f.p = h
c.t = l
c.z = e
e.o = j
e.s = a
assert a.s.s.s.o.s.w.s.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.z: D = None
        self.txt = txt

a = A("a")
l = B("l")
h = C("h")
b = D("b")
n = E("n")
j = F("j")
m = A("m")
f = B("f")
c = F("c")
e = D("e")

a.s = n
l.t = j
l.p = h
h.y = j
h.x = f
h.o = a
b.o = j
b.s = a
n.s = m
n.o = m
n.x = h
n.v = h
n.w = e
j.t = l
j.z = b
m.s = n
f.t = c
f.p = h
c.t = l
c.z = e
e.o = j
e.s = a
assert a.s.s.s.o.s.w.s.s.v.txt == "h"