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

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

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

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

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

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

f = A("f")
a = B("a")
m = C("m")
e = D("e")
i = E("i")
g = F("g")
j = A("j")

f.s = e
f.w = i
a.v = e
a.x = g
a.w = g
m.u = g
m.r = g
e.t = m
e.q = a
e.v = i
i.q = m
i.t = m
i.u = m
i.v = e
i.r = a
g.s = i
g.x = i
g.p = f
g.q = f
g.w = a
g.t = j
j.s = e
j.w = i
assert g.w.x.q.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: E = None
        self.txt = txt

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

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

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

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

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

f = A("f")
a = B("a")
m = C("m")
e = D("e")
i = E("i")
g = F("g")
j = A("j")

f.s = e
f.w = i
a.v = e
a.x = g
a.w = g
m.u = g
m.r = g
e.t = m
e.q = a
e.v = i
i.q = m
i.t = m
i.u = m
i.v = e
i.r = a
g.s = i
g.x = i
g.p = f
g.q = f
g.w = a
g.t = j
j.s = e
j.w = i
assert g.w.x.q.w.txt == "i"