class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.q: B = None
        self.r: G = None
        self.t: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: D = None
        self.txt = txt

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

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