class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: B = None
        self.t: F = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.t: D = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

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

h.v = i
h.o = b
h.y = b
h.t = l
b.y = l
d.s = b
i.w = h
i.s = b
i.v = b
e.o = d
l.v = e
l.x = i
l.t = i
l.z = i
l.p = d
assert d.s.y.v.o.s.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: B = None
        self.t: F = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: D = None
        self.t: D = None
        self.z: D = None
        self.p: C = None
        self.txt = txt

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

h.v = i
h.o = b
h.y = b
h.t = l
b.y = l
d.s = b
i.w = h
i.s = b
i.v = b
e.o = d
l.v = e
l.x = i
l.t = i
l.z = i
l.p = d
assert d.s.y.v.o.s.y.txt == "l"