class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.t: C = None
        self.r: F = None
        self.txt = txt

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

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

f.r = i
f.s = g
f.y = k
n.y = k
n.s = k
n.v = k
n.p = k
n.u = f
i.z = k
i.w = g
i.q = g
i.y = l
i.s = f
i.u = n
k.y = e
k.x = g
k.t = l
k.s = f
g.y = k
g.v = k
g.t = i
g.r = l
l.u = e
l.x = e
l.v = f
l.y = k
l.s = k
l.z = g
e.y = k
e.s = k
e.v = k
e.p = k
e.u = f
assert f.s.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.s: E = None
        self.y: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.t: C = None
        self.r: F = None
        self.txt = txt

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

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

f.r = i
f.s = g
f.y = k
n.y = k
n.s = k
n.v = k
n.p = k
n.u = f
i.z = k
i.w = g
i.q = g
i.y = l
i.s = f
i.u = n
k.y = e
k.x = g
k.t = l
k.s = f
g.y = k
g.v = k
g.t = i
g.r = l
l.u = e
l.x = e
l.v = f
l.y = k
l.s = k
l.z = g
e.y = k
e.s = k
e.v = k
e.p = k
e.u = f
assert f.s.v.x.txt == "g"