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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.v: F = None
        self.r: E = None
        self.t: D = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.r: D = None
        self.x: A = None
        self.w: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: A = None
        self.t: E = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.w: E = None
        self.v: F = None
        self.r: E = None
        self.t: D = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: C = None
        self.r: D = None
        self.x: A = None
        self.w: G = None
        self.txt = txt

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

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

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