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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

j = A("j")
m = B("m")
e = C("e")
h = D("h")
i = E("i")
f = F("f")
n = B("n")

j.o = f
j.s = e
m.u = j
m.s = f
m.t = h
e.y = n
e.s = i
e.w = f
h.r = e
h.x = i
i.o = e
i.u = j
f.r = i
f.s = i
f.x = n
f.y = h
f.w = j
f.t = j
n.u = j
n.s = f
n.t = h
assert j.s.y.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: A = None
        self.txt = txt

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

j = A("j")
m = B("m")
e = C("e")
h = D("h")
i = E("i")
f = F("f")
n = B("n")

j.o = f
j.s = e
m.u = j
m.s = f
m.t = h
e.y = n
e.s = i
e.w = f
h.r = e
h.x = i
i.o = e
i.u = j
f.r = i
f.s = i
f.x = n
f.y = h
f.w = j
f.t = j
n.u = j
n.s = f
n.t = h
assert j.s.y.s.s.txt == "i"