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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: C = None
        self.q: F = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.s: F = None
        self.z: D = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

h = A("h")
n = B("n")
i = C("i")
e = D("e")
b = E("b")
l = F("l")

h.v = n
h.p = b
n.s = b
n.r = i
n.q = l
n.w = l
i.r = h
i.v = b
e.o = n
e.r = h
b.y = i
b.v = n
b.s = l
b.z = e
b.o = h
b.w = h
l.r = h
l.z = h
l.s = i
assert l.s.r.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.r: C = None
        self.q: F = None
        self.w: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.s: F = None
        self.z: D = None
        self.o: A = None
        self.w: A = None
        self.txt = txt

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

h = A("h")
n = B("n")
i = C("i")
e = D("e")
b = E("b")
l = F("l")

h.v = n
h.p = b
n.s = b
n.r = i
n.q = l
n.w = l
i.r = h
i.v = b
e.o = n
e.r = h
b.y = i
b.v = n
b.s = l
b.z = e
b.o = h
b.w = h
l.r = h
l.z = h
l.s = i
assert l.s.r.v.w.txt == "l"