class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: A = None
        self.r: G = None
        self.p: C = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: D = None
        self.q: C = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: G = None
        self.p: H = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: H = None
        self.o: H = None
        self.w: H = None
        self.x: C = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: A = None
        self.r: G = None
        self.p: C = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: D = None
        self.q: C = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.r: G = None
        self.p: H = None
        self.x: G = None
        self.y: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: H = None
        self.o: H = None
        self.w: H = None
        self.x: C = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

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

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