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

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

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

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

m = A("m")
j = B("j")
h = C("h")
i = D("i")
c = B("c")
k = A("k")
a = C("a")
f = A("f")
g = B("g")

m.x = i
m.v = c
j.s = g
j.w = i
j.v = i
j.o = i
h.u = a
h.s = m
i.y = k
i.o = k
i.x = m
c.s = g
c.w = i
c.v = i
c.o = i
k.x = i
k.v = g
a.u = h
a.s = k
f.x = i
f.v = j
g.s = j
g.w = i
g.v = i
g.o = i
assert c.o.y.v.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: B = None
        self.txt = txt

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

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

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

m = A("m")
j = B("j")
h = C("h")
i = D("i")
c = B("c")
k = A("k")
a = C("a")
f = A("f")
g = B("g")

m.x = i
m.v = c
j.s = g
j.w = i
j.v = i
j.o = i
h.u = a
h.s = m
i.y = k
i.o = k
i.x = m
c.s = g
c.w = i
c.v = i
c.o = i
k.x = i
k.v = g
a.u = h
a.s = k
f.x = i
f.v = j
g.s = j
g.w = i
g.v = i
g.o = i
assert c.o.y.v.s.s.txt == "g"