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

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

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

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

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

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

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

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

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

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

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

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

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

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

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