class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.p: A = None
        self.q: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
m = C("m")
a = D("a")
i = E("i")
k = F("k")

n.o = k
n.p = m
n.w = m
l.r = m
l.u = m
l.v = m
l.p = n
l.q = n
m.r = i
m.w = k
m.t = l
a.s = k
a.v = k
a.z = l
a.q = m
a.u = i
i.s = l
i.u = l
k.u = m
k.y = n
assert n.p.t.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: C = None
        self.w: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: C = None
        self.p: A = None
        self.q: A = None
        self.v: C = None
        self.txt = txt

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

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

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

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

n = A("n")
l = B("l")
m = C("m")
a = D("a")
i = E("i")
k = F("k")

n.o = k
n.p = m
n.w = m
l.r = m
l.u = m
l.v = m
l.p = n
l.q = n
m.r = i
m.w = k
m.t = l
a.s = k
a.v = k
a.z = l
a.q = m
a.u = i
i.s = l
i.u = l
k.u = m
k.y = n
assert n.p.t.p.p.txt == "m"