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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: D = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

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

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

l.x = e
l.s = e
l.o = a
b.x = a
b.r = k
b.t = k
b.q = c
b.p = e
m.r = b
m.y = l
a.s = l
a.p = c
n.r = l
n.w = a
n.q = k
n.s = b
e.t = l
e.v = k
e.q = b
f.t = l
f.v = a
f.q = b
c.r = l
c.w = k
c.q = a
c.s = b
k.s = l
k.p = n
assert c.r.o.p.s.x.p.q.s.o.txt == "a"