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

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

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

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

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

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

a = A("a")
g = B("g")
d = C("d")
h = D("h")
c = E("c")
j = F("j")
n = E("n")
b = D("b")

a.x = c
a.q = j
a.s = j
a.w = g
g.v = d
g.y = a
g.r = b
g.o = b
g.t = c
g.q = j
d.w = j
h.y = b
h.s = b
h.v = d
h.w = d
h.x = j
c.w = h
c.v = j
j.s = d
j.q = n
n.w = b
n.v = j
b.y = h
b.s = h
b.v = d
b.w = d
b.x = j
assert j.q.w.w.w.s.w.s.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: F = None
        self.s: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

a = A("a")
g = B("g")
d = C("d")
h = D("h")
c = E("c")
j = F("j")
n = E("n")
b = D("b")

a.x = c
a.q = j
a.s = j
a.w = g
g.v = d
g.y = a
g.r = b
g.o = b
g.t = c
g.q = j
d.w = j
h.y = b
h.s = b
h.v = d
h.w = d
h.x = j
c.w = h
c.v = j
j.s = d
j.q = n
n.w = b
n.v = j
b.y = h
b.s = h
b.v = d
b.w = d
b.x = j
assert j.q.w.w.w.s.w.s.w.txt == "j"