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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

d = A("d")
c = B("c")
g = C("g")
b = D("b")
k = E("k")
f = F("f")

d.v = b
d.p = f
d.q = f
d.z = g
d.y = g
d.s = k
c.s = f
c.t = f
c.p = k
g.o = f
g.z = f
g.y = f
g.q = b
b.v = k
k.p = g
f.v = b
f.z = d
assert b.v.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: F = None
        self.q: F = None
        self.z: C = None
        self.s: E = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.p: E = None
        self.txt = txt

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

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

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

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

d = A("d")
c = B("c")
g = C("g")
b = D("b")
k = E("k")
f = F("f")

d.v = b
d.p = f
d.q = f
d.z = g
d.y = g
d.s = k
c.s = f
c.t = f
c.p = k
g.o = f
g.z = f
g.y = f
g.q = b
b.v = k
k.p = g
f.v = b
f.z = d
assert b.v.p.z.txt == "f"