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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

k.p = j
k.q = d
k.s = m
g.r = l
g.u = m
g.x = k
d.r = g
d.v = f
f.s = c
j.x = m
j.v = m
j.t = m
m.w = k
m.t = j
m.s = d
m.u = g
l.r = g
l.u = m
l.x = k
c.s = n
n.s = c
assert l.r.x.p.t.s.v.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.x: A = None
        self.txt = txt

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

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

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

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

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

k.p = j
k.q = d
k.s = m
g.r = l
g.u = m
g.x = k
d.r = g
d.v = f
f.s = c
j.x = m
j.v = m
j.t = m
m.w = k
m.t = j
m.s = d
m.u = g
l.r = g
l.u = m
l.x = k
c.s = n
n.s = c
assert l.r.x.p.t.s.v.s.s.txt == "n"