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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.x: D = None
        self.u: C = None
        self.txt = txt

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

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