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

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

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

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

e = A("e")
j = B("j")
m = C("m")
b = D("b")
f = A("f")
k = D("k")
g = A("g")
n = C("n")

e.v = k
e.s = j
e.u = b
j.w = f
m.w = b
b.x = g
b.t = m
f.v = k
f.s = j
f.u = b
k.x = g
k.t = n
g.v = k
g.s = j
g.u = b
n.w = k
assert g.s.w.v.x.s.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: B = None
        self.u: D = None
        self.txt = txt

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

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

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

e = A("e")
j = B("j")
m = C("m")
b = D("b")
f = A("f")
k = D("k")
g = A("g")
n = C("n")

e.v = k
e.s = j
e.u = b
j.w = f
m.w = b
b.x = g
b.t = m
f.v = k
f.s = j
f.u = b
k.x = g
k.t = n
g.v = k
g.s = j
g.u = b
n.w = k
assert g.s.w.v.x.s.w.s.w.txt == "f"