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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: F = None
        self.v: E = None
        self.p: C = None
        self.y: D = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.w: A = None
        self.y: B = None
        self.x: G = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: F = None
        self.v: E = None
        self.p: C = None
        self.y: D = None
        self.u: E = None
        self.s: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: A = None
        self.w: A = None
        self.y: B = None
        self.x: G = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.t: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

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

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