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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: A = None
        self.y: F = None
        self.s: A = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: D = None
        self.q: E = None
        self.w: B = None
        self.r: E = None
        self.s: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.v: A = None
        self.y: D = None
        self.q: E = None
        self.w: D = None
        self.u: C = None
        self.txt = txt

i = A("i")
n = B("n")
l = C("l")
j = D("j")
h = E("h")
e = F("e")
g = G("g")

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: A = None
        self.y: F = None
        self.s: A = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.y: D = None
        self.q: E = None
        self.w: B = None
        self.r: E = None
        self.s: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: D = None
        self.v: A = None
        self.y: D = None
        self.q: E = None
        self.w: D = None
        self.u: C = None
        self.txt = txt

i = A("i")
n = B("n")
l = C("l")
j = D("j")
h = E("h")
e = F("e")
g = G("g")

i.w = j
i.z = e
i.s = e
n.q = e
n.o = e
n.p = e
n.x = l
n.y = j
n.u = j
l.o = g
l.p = i
l.s = i
l.y = e
l.t = e
j.u = l
j.w = i
h.r = i
h.w = e
e.z = g
e.s = g
e.y = j
e.q = h
e.r = h
e.w = n
e.o = n
g.s = h
g.q = h
g.x = j
g.y = j
g.w = j
g.v = i
g.u = l
assert h.r.s.q.w.r.w.y.txt == "j"