class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.w: F = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

l.s = i
l.z = m
l.v = m
l.w = n
l.o = k
m.p = g
m.u = l
m.q = i
j.p = g
j.w = n
j.r = l
i.s = g
i.o = m
i.p = n
g.x = n
g.v = n
g.w = m
g.u = i
n.o = k
n.s = j
n.y = j
n.z = l
k.x = n
k.v = n
k.w = m
k.u = i
assert k.w.q.o.q.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: B = None
        self.w: F = None
        self.o: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

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