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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.z: H = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.w: D = None
        self.p: E = None
        self.t: A = None
        self.r: D = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: G = None
        self.z: H = None
        self.t: H = None
        self.v: H = None
        self.y: H = None
        self.r: D = None
        self.txt = txt

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

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

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

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

l.v = k
l.p = d
l.r = n
l.s = f
b.x = h
b.u = f
b.z = m
b.v = m
h.u = m
h.q = k
h.v = n
h.s = l
d.o = l
d.y = l
d.t = l
d.s = l
d.w = n
d.r = n
d.p = k
k.p = i
k.w = j
k.z = m
k.t = m
k.v = m
k.y = m
k.r = d
i.v = l
i.w = m
j.q = b
m.r = l
n.o = l
n.y = l
n.t = l
n.s = l
n.w = d
n.r = d
n.p = k
f.u = m
f.q = k
f.v = n
f.s = l
assert f.s.p.o.s.v.o.s.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.p: D = None
        self.r: D = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: C = None
        self.z: H = None
        self.v: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: A = None
        self.w: D = None
        self.p: E = None
        self.t: A = None
        self.r: D = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: G = None
        self.z: H = None
        self.t: H = None
        self.v: H = None
        self.y: H = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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