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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

e = A("e")
j = B("j")
f = C("f")
a = D("a")
c = E("c")
k = F("k")

e.u = k
e.x = c
j.v = c
j.y = e
j.x = f
f.x = e
a.t = c
a.v = c
a.u = j
c.y = j
k.s = a
k.w = a
k.y = a
k.o = c
assert f.x.u.w.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: D = None
        self.y: D = None
        self.o: E = None
        self.txt = txt

e = A("e")
j = B("j")
f = C("f")
a = D("a")
c = E("c")
k = F("k")

e.u = k
e.x = c
j.v = c
j.y = e
j.x = f
f.x = e
a.t = c
a.v = c
a.u = j
c.y = j
k.s = a
k.w = a
k.y = a
k.o = c
assert f.x.u.w.u.v.txt == "c"