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

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

k = A("k")
b = B("b")
h = C("h")
g = D("g")
a = C("a")
e = D("e")
f = B("f")
i = A("i")
d = D("d")

k.s = h
k.p = h
b.t = f
b.s = a
b.r = i
b.y = i
h.o = k
h.v = a
h.r = e
g.w = f
g.v = i
g.s = k
a.o = k
a.v = h
a.r = d
e.w = b
e.v = i
e.s = k
f.t = b
f.s = h
f.r = i
f.y = k
i.s = a
i.p = a
d.w = b
d.v = i
d.s = i
assert b.y.p.v.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: A = None
        self.s: A = None
        self.txt = txt

k = A("k")
b = B("b")
h = C("h")
g = D("g")
a = C("a")
e = D("e")
f = B("f")
i = A("i")
d = D("d")

k.s = h
k.p = h
b.t = f
b.s = a
b.r = i
b.y = i
h.o = k
h.v = a
h.r = e
g.w = f
g.v = i
g.s = k
a.o = k
a.v = h
a.r = d
e.w = b
e.v = i
e.s = k
f.t = b
f.s = h
f.r = i
f.y = k
i.s = a
i.p = a
d.w = b
d.v = i
d.s = i
assert b.y.p.v.o.txt == "k"