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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.y: E = None
        self.o: A = None
        self.txt = txt

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

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

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

n = A("n")
f = B("f")
i = C("i")
c = D("c")
m = E("m")
a = F("a")
e = D("e")
k = E("k")

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

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

class C:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: B = None
        self.y: E = None
        self.o: A = None
        self.txt = txt

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

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

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

n = A("n")
f = B("f")
i = C("i")
c = D("c")
m = E("m")
a = F("a")
e = D("e")
k = E("k")

n.u = m
f.v = n
f.y = n
f.x = e
i.s = f
i.w = f
i.y = k
i.o = n
c.v = f
c.y = f
c.u = i
m.u = f
m.p = f
m.x = f
m.s = a
m.w = i
m.t = n
a.v = n
a.y = f
e.v = f
e.y = f
e.u = i
k.u = f
k.p = f
k.x = f
k.s = a
k.w = i
k.t = n
assert c.y.y.u.txt == "m"