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

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

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

g = A("g")
b = B("b")
m = C("m")
l = B("l")
f = C("f")
i = A("i")
e = B("e")
d = C("d")
j = A("j")

g.s = f
b.u = g
b.x = f
b.v = j
m.t = b
m.w = b
m.p = d
l.u = g
l.x = m
l.v = j
f.t = l
f.w = l
f.p = d
i.s = d
e.u = g
e.x = d
e.v = i
d.t = e
d.p = f
d.w = b
j.s = f
assert j.s.w.x.w.v.s.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

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

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

g = A("g")
b = B("b")
m = C("m")
l = B("l")
f = C("f")
i = A("i")
e = B("e")
d = C("d")
j = A("j")

g.s = f
b.u = g
b.x = f
b.v = j
m.t = b
m.w = b
m.p = d
l.u = g
l.x = m
l.v = j
f.t = l
f.w = l
f.p = d
i.s = d
e.u = g
e.x = d
e.v = i
d.t = e
d.p = f
d.w = b
j.s = f
assert j.s.w.x.w.v.s.w.u.txt == "g"