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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.w: A = None
        self.u: D = None
        self.q: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: F = None
        self.x: E = None
        self.r: D = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: C = None
        self.w: A = None
        self.u: D = None
        self.q: D = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: F = None
        self.x: E = None
        self.r: D = None
        self.s: C = None
        self.w: E = None
        self.txt = txt

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

l.q = f
j.x = f
j.t = n
m.r = j
m.u = h
m.t = h
h.p = i
h.s = i
h.w = l
h.u = f
h.q = f
n.s = b
n.r = b
g.p = a
g.y = b
g.x = n
g.w = n
g.r = h
g.s = i
i.r = j
i.u = f
i.t = h
b.p = m
b.s = m
b.y = g
b.x = n
b.w = n
b.r = h
a.r = j
a.u = h
a.t = f
f.p = a
f.s = a
f.w = l
f.u = h
f.q = h
assert n.s.p.u.s.r.x.s.r.txt == "j"