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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

n = A("n")
l = B("l")
d = C("d")
h = B("h")
c = A("c")
j = C("j")

n.y = j
n.t = c
n.v = c
l.y = j
l.p = h
l.v = d
d.r = n
d.w = c
d.o = j
h.y = j
h.v = j
h.p = l
c.y = j
c.t = n
c.v = n
j.r = n
j.w = n
j.o = d
assert d.w.y.r.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

n = A("n")
l = B("l")
d = C("d")
h = B("h")
c = A("c")
j = C("j")

n.y = j
n.t = c
n.v = c
l.y = j
l.p = h
l.v = d
d.r = n
d.w = c
d.o = j
h.y = j
h.v = j
h.p = l
c.y = j
c.t = n
c.v = n
j.r = n
j.w = n
j.o = d
assert d.w.y.r.t.v.txt == "n"