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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: F = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: F = None
        self.w: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.o: A = None
        self.txt = txt

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

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

l.x = m
l.t = m
l.v = e
k.q = n
k.u = n
k.w = a
m.v = a
a.s = l
e.p = m
e.s = a
e.o = l
n.s = k
n.y = m
n.p = e
assert n.y.v.s.txt == "l"