class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.o: F = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

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

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

f = A("f")
e = B("e")
k = C("k")
g = D("g")
n = E("n")
c = F("c")

f.v = e
f.u = n
f.y = c
f.z = c
e.t = f
e.q = k
e.u = n
e.p = c
k.p = g
k.u = c
k.v = n
k.x = n
g.q = e
g.t = f
g.o = c
g.s = c
g.x = n
n.t = e
n.u = c
c.t = n
c.z = k
assert f.v.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.y: F = None
        self.z: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.t: A = None
        self.o: F = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

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

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

f = A("f")
e = B("e")
k = C("k")
g = D("g")
n = E("n")
c = F("c")

f.v = e
f.u = n
f.y = c
f.z = c
e.t = f
e.q = k
e.u = n
e.p = c
k.p = g
k.u = c
k.v = n
k.x = n
g.q = e
g.t = f
g.o = c
g.s = c
g.x = n
n.t = e
n.u = c
c.t = n
c.z = k
assert f.v.t.v.t.txt == "f"