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

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

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

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

f = A("f")
g = B("g")
c = C("c")
e = D("e")
k = D("k")
m = B("m")
b = D("b")
l = C("l")
a = C("a")
j = B("j")

f.s = c
f.o = e
f.y = j
g.y = f
g.s = l
c.x = g
c.o = l
c.w = b
c.v = f
e.t = l
k.t = a
m.y = f
m.s = c
b.t = a
l.x = g
l.o = a
l.w = b
l.v = f
a.x = m
a.o = c
a.w = e
a.v = f
j.y = f
j.s = c
assert a.o.v.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: D = None
        self.y: B = None
        self.txt = txt

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

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

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

f = A("f")
g = B("g")
c = C("c")
e = D("e")
k = D("k")
m = B("m")
b = D("b")
l = C("l")
a = C("a")
j = B("j")

f.s = c
f.o = e
f.y = j
g.y = f
g.s = l
c.x = g
c.o = l
c.w = b
c.v = f
e.t = l
k.t = a
m.y = f
m.s = c
b.t = a
l.x = g
l.o = a
l.w = b
l.v = f
a.x = m
a.o = c
a.w = e
a.v = f
j.y = f
j.s = c
assert a.o.v.s.txt == "c"