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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.txt = txt

h = A("h")
l = B("l")
k = C("k")
d = D("d")
b = E("b")
f = F("f")

h.z = l
h.v = b
h.x = k
l.t = b
l.r = d
k.v = b
k.p = b
k.q = d
k.z = d
k.s = f
d.v = k
d.o = h
b.p = f
b.v = d
f.y = h
f.z = d
assert f.z.v.s.z.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: A = None
        self.z: D = None
        self.txt = txt

h = A("h")
l = B("l")
k = C("k")
d = D("d")
b = E("b")
f = F("f")

h.z = l
h.v = b
h.x = k
l.t = b
l.r = d
k.v = b
k.p = b
k.q = d
k.z = d
k.s = f
d.v = k
d.o = h
b.p = f
b.v = d
f.y = h
f.z = d
assert f.z.v.s.z.v.v.txt == "b"