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

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

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

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

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

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

i = A("i")
d = B("d")
g = C("g")
n = D("n")
h = E("h")
f = F("f")

i.r = f
i.z = d
i.t = d
i.u = d
i.o = n
d.r = g
d.s = g
g.x = n
g.v = h
n.w = i
n.u = f
n.s = f
n.q = d
n.t = d
h.y = d
h.w = d
h.v = f
h.o = i
f.r = g
f.t = i
f.w = i
f.x = h
assert h.v.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: B = None
        self.o: D = None
        self.t: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

i = A("i")
d = B("d")
g = C("g")
n = D("n")
h = E("h")
f = F("f")

i.r = f
i.z = d
i.t = d
i.u = d
i.o = n
d.r = g
d.s = g
g.x = n
g.v = h
n.w = i
n.u = f
n.s = f
n.q = d
n.t = d
h.y = d
h.w = d
h.v = f
h.o = i
f.r = g
f.t = i
f.w = i
f.x = h
assert h.v.t.r.txt == "f"