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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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