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

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

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

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

h = A("h")
n = B("n")
f = C("f")
k = D("k")
m = A("m")
l = D("l")

h.w = f
h.y = n
h.t = l
n.s = k
n.v = l
n.u = l
f.v = h
k.u = l
k.x = l
k.t = n
m.w = f
m.y = n
m.t = l
l.u = k
l.x = k
l.t = n
assert n.s.t.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

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

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

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

h = A("h")
n = B("n")
f = C("f")
k = D("k")
m = A("m")
l = D("l")

h.w = f
h.y = n
h.t = l
n.s = k
n.v = l
n.u = l
f.v = h
k.u = l
k.x = l
k.t = n
m.w = f
m.y = n
m.t = l
l.u = k
l.x = k
l.t = n
assert n.s.t.v.x.txt == "k"