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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.p: D = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.p: A = None
        self.z: D = None
        self.u: A = None
        self.r: D = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
n = C("n")
e = D("e")
b = E("b")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: E = None
        self.p: D = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.s: D = None
        self.p: A = None
        self.z: D = None
        self.u: A = None
        self.r: D = None
        self.txt = txt

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

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

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

g = A("g")
i = B("i")
n = C("n")
e = D("e")
b = E("b")
d = F("d")

g.z = e
g.o = i
g.u = d
i.t = n
i.s = n
i.z = b
i.p = e
i.q = e
n.y = d
n.s = e
n.z = e
n.r = e
n.p = g
n.u = g
e.r = b
e.t = g
e.s = d
b.p = e
b.r = i
b.s = d
d.x = g
d.t = n
assert i.s.z.r.s.txt == "d"