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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

g = A("g")
m = B("m")
d = C("d")
h = D("h")
j = E("j")
f = F("f")
l = G("l")
a = C("a")
e = E("e")

g.x = d
g.q = m
m.w = g
m.t = d
d.s = m
d.y = m
d.u = j
d.z = j
d.w = g
d.t = f
d.r = a
h.s = j
h.z = m
h.y = l
h.t = l
h.q = l
h.v = e
j.q = f
j.z = a
f.t = g
l.u = f
l.p = f
l.w = m
l.o = d
a.s = m
a.y = m
a.u = j
a.w = g
a.t = f
a.z = e
a.r = d
e.q = f
e.z = a
assert l.w.t.t.t.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: B = None
        self.p: F = None
        self.o: C = None
        self.txt = txt

g = A("g")
m = B("m")
d = C("d")
h = D("h")
j = E("j")
f = F("f")
l = G("l")
a = C("a")
e = E("e")

g.x = d
g.q = m
m.w = g
m.t = d
d.s = m
d.y = m
d.u = j
d.z = j
d.w = g
d.t = f
d.r = a
h.s = j
h.z = m
h.y = l
h.t = l
h.q = l
h.v = e
j.q = f
j.z = a
f.t = g
l.u = f
l.p = f
l.w = m
l.o = d
a.s = m
a.y = m
a.u = j
a.w = g
a.t = f
a.z = e
a.r = d
e.q = f
e.z = a
assert l.w.t.t.t.x.w.txt == "g"