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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

h = A("h")
k = B("k")
a = C("a")
d = D("d")
c = E("c")
e = F("e")

h.v = k
h.q = e
h.t = a
k.p = h
a.x = c
a.z = e
d.x = a
d.v = e
d.s = e
d.p = h
d.q = c
c.v = k
c.r = h
c.p = a
c.z = a
c.y = a
c.s = a
e.t = d
assert k.p.v.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: F = None
        self.t: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

h = A("h")
k = B("k")
a = C("a")
d = D("d")
c = E("c")
e = F("e")

h.v = k
h.q = e
h.t = a
k.p = h
a.x = c
a.z = e
d.x = a
d.v = e
d.s = e
d.p = h
d.q = c
c.v = k
c.r = h
c.p = a
c.z = a
c.y = a
c.s = a
e.t = d
assert k.p.v.p.t.txt == "a"