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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: C = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

b.s = a
b.t = a
b.w = g
b.r = g
b.p = k
k.y = g
k.o = g
k.q = b
k.s = a
k.p = n
f.o = m
f.w = l
f.t = e
f.q = g
m.w = g
m.p = f
g.p = n
g.o = e
a.r = l
a.u = f
a.z = k
l.o = e
l.t = e
l.w = f
l.q = g
n.p = g
n.o = m
e.w = n
e.p = f
assert e.w.p.p.p.p.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: F = None
        self.w: E = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: C = None
        self.t: D = None
        self.q: E = None
        self.txt = txt

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

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

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

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

b.s = a
b.t = a
b.w = g
b.r = g
b.p = k
k.y = g
k.o = g
k.q = b
k.s = a
k.p = n
f.o = m
f.w = l
f.t = e
f.q = g
m.w = g
m.p = f
g.p = n
g.o = e
a.r = l
a.u = f
a.z = k
l.o = e
l.t = e
l.w = f
l.q = g
n.p = g
n.o = m
e.w = n
e.p = f
assert e.w.p.p.p.p.p.p.txt == "n"