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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
l = C("l")
d = D("d")
i = E("i")
g = F("g")
a = F("a")
b = B("b")
c = F("c")

f.s = b
e.s = f
e.w = f
e.o = f
e.r = g
e.u = i
l.w = a
d.v = b
i.r = f
g.q = f
g.u = c
g.y = l
g.x = i
g.s = a
a.q = f
a.u = c
a.y = l
a.x = i
a.s = g
b.s = f
b.w = f
b.o = f
b.r = a
b.u = i
c.q = f
c.u = a
c.y = l
c.x = i
c.s = g
assert f.s.o.s.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

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

f = A("f")
e = B("e")
l = C("l")
d = D("d")
i = E("i")
g = F("g")
a = F("a")
b = B("b")
c = F("c")

f.s = b
e.s = f
e.w = f
e.o = f
e.r = g
e.u = i
l.w = a
d.v = b
i.r = f
g.q = f
g.u = c
g.y = l
g.x = i
g.s = a
a.q = f
a.u = c
a.y = l
a.x = i
a.s = g
b.s = f
b.w = f
b.o = f
b.r = a
b.u = i
c.q = f
c.u = a
c.y = l
c.x = i
c.s = g
assert f.s.o.s.r.txt == "a"