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

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: F = None
        self.s: B = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
e = C("e")
i = D("i")
h = E("h")
m = F("m")
f = E("f")
j = B("j")
k = C("k")

a.u = j
b.t = i
b.v = a
b.y = m
e.v = f
e.t = m
e.s = b
e.w = k
e.r = k
i.w = m
i.r = a
i.z = k
h.r = b
h.w = b
h.y = f
m.s = h
m.u = i
m.v = e
m.x = a
f.r = j
f.w = j
f.y = h
j.t = i
j.v = a
j.y = m
k.v = f
k.t = m
k.s = b
k.w = e
k.r = e
assert f.w.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.t: F = None
        self.s: B = None
        self.w: C = None
        self.r: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.y: E = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
b = B("b")
e = C("e")
i = D("i")
h = E("h")
m = F("m")
f = E("f")
j = B("j")
k = C("k")

a.u = j
b.t = i
b.v = a
b.y = m
e.v = f
e.t = m
e.s = b
e.w = k
e.r = k
i.w = m
i.r = a
i.z = k
h.r = b
h.w = b
h.y = f
m.s = h
m.u = i
m.v = e
m.x = a
f.r = j
f.w = j
f.y = h
j.t = i
j.v = a
j.y = m
k.v = f
k.t = m
k.s = b
k.w = e
k.r = e
assert f.w.y.x.txt == "a"