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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

j = A("j")
k = B("k")
e = C("e")
l = D("l")
d = E("d")
b = F("b")
n = C("n")

j.u = e
j.x = k
j.z = b
j.r = b
j.v = n
k.x = e
k.s = d
e.y = d
e.z = j
e.x = j
l.t = k
l.v = j
d.y = b
d.u = b
d.v = k
b.r = d
n.y = d
n.z = j
n.x = j
assert j.x.s.v.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.z: F = None
        self.r: F = None
        self.v: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.txt = txt

j = A("j")
k = B("k")
e = C("e")
l = D("l")
d = E("d")
b = F("b")
n = C("n")

j.u = e
j.x = k
j.z = b
j.r = b
j.v = n
k.x = e
k.s = d
e.y = d
e.z = j
e.x = j
l.t = k
l.v = j
d.y = b
d.u = b
d.v = k
b.r = d
n.y = d
n.z = j
n.x = j
assert j.x.s.v.x.x.txt == "j"