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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: D = None
        self.q: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

n = A("n")
g = B("g")
h = C("h")
m = D("m")

n.v = h
n.t = h
n.u = g
g.z = m
g.w = n
g.t = n
h.o = g
h.q = g
h.u = m
h.t = n
m.z = g
assert h.u.z.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: C = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: D = None
        self.q: B = None
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

n = A("n")
g = B("g")
h = C("h")
m = D("m")

n.v = h
n.t = h
n.u = g
g.z = m
g.w = n
g.t = n
h.o = g
h.q = g
h.u = m
h.t = n
m.z = g
assert h.u.z.t.txt == "n"