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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.v: F = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: D = None
        self.v: F = None
        self.w: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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