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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: E = None
        self.y: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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